<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.3.5 发布, 多工具链灵活切换支持</title>
    <meta name="description" content="这个版本主要工作还是继续改进对工具链的支持，上个版本虽然通过重构实现了模块化的工具链扩展，但是对于一次编译想要灵活地在交叉工具链/Host工具链上切换编译，还不能很好的支持，因此这个版本重点改进了这块的支持力度。另外，此版本还对使用add_requires集成的远程依赖包下载慢的问题做了改进，增加了代理设置、本地...">

    
    <meta name="keywords" content="xmake,lua,C/C++,toolchains,交叉编译,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/cn/2020/06/28/xmake-update-v2.3.5/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />

    <!-- css -->
    <link href="/css/reward.css" rel="stylesheet" type="text/css"> 




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/cn" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/?lang=0">
                    
                        <i class="fa fa-home"></i>English
                    </a>
                </li>

                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>项目
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/archive/">
                            
                        
                            <i class="fa fa-archive"></i>归档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/category/">
                            
                        
                            <i class="fa fa-th-list"></i>分类
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/tag/">
                            
                        
                            <i class="fa fa-tags"></i>标记
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/docs/">
                            
                        
                            <i class="fa fa-book"></i>文档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="https://xmake.io/#/zh-cn/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>社区
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/donation/">
                            
                        
                            <i class="fa fa-heart"></i>捐助
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/about/">
                            
                        
                            <i class="fa fa-user"></i>关于
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.3.5 发布, 多工具链灵活切换支持</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2020-06-28
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/cn/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/cn/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/cn/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#toolchains" title="Tag: toolchains" rel="tag">toolchains</a-->
        <a href="/cn/tag/#toolchains" title="Tag: toolchains" rel="tag">toolchains</a>&nbsp;
    
        <!--a href="/tag/#%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91" title="Tag: 交叉编译" rel="tag">交叉编译</a-->
        <a href="/cn/tag/#交叉编译" title="Tag: 交叉编译" rel="tag">交叉编译</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p>这个版本主要工作还是继续改进对工具链的支持，上个版本虽然通过重构实现了模块化的工具链扩展，但是对于一次编译想要灵活地在交叉工具链/Host工具链上切换编译，还不能很好的支持，因此这个版本重点改进了这块的支持力度。</p>

<p>另外，此版本还对使用<code class="highlighter-rouge">add_requires</code>集成的远程依赖包下载慢的问题做了改进，增加了代理设置、本地包检索复用的支持来改善此问题。当然，最好的方式还是搞个国内的cdn来加速下载，但是这个成本过高，暂时就不折腾了。</p>

<p>还有一些小改动和bug修复，可以看下文章最下面的更新内容。</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">项目源码</a></li>
  <li><a href="https://xmake.io/#/zh-cn/">官方文档</a></li>
</ul>

<h2 id="新特性介绍">新特性介绍</h2>

<h3 id="多工具链灵活切换">多工具链灵活切换</h3>

<p>关于这块的一个example，可以参考luajit项目，里面的编译流程需要先编译host平台下minilua/buildvm两个target，然后再通过minilua/buildvm生成对应目标平台的jit代码参与整体luajit库的编译。</p>

<p>因此整个编译过程需要先对特定target采用host工具链，然后对其他target再使用交叉工具链完成编译。</p>

<p>那我们应该如何配置xmake.lua去实现这种方式呢，一种就是通过<code class="highlighter-rouge">set_toolchains</code>接口，对特定target设置指定的host工具链，例如：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"buildvm"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"xcode"</span><span class="p">,</span> <span class="p">{</span><span class="n">plat</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">host</span><span class="p">(),</span> <span class="n">arch</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">arch</span><span class="p">()})</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"luajit"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"static"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"buildvm"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
</code></pre>
</div>

<p>如果当前是在交叉编译模式，即使执行下面的命令配置成android编译平台，其buildvm实际还是在使用xcode编译macOS目标程序，仅仅luajit库是采用ndk工具链编译：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f -p android --ndk=/xxxx
</span></code></pre>
</div>

<p>但是，这还不是特别方便，尤其是跨平台编译时候，不同平台的pc工具链都是不同的，有msvc, xcode, clang等，还需要判断平台来指定。</p>

<p>我们还可以继续通用化，让xmake针对不同平台自动选用当前可用的Host工具链，而不是显式指定特定工具链，改进成下面的版本：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"buildvm"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
    <span class="n">set_plat</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">host</span><span class="p">())</span>
    <span class="n">set_host</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">arch</span><span class="p">())</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"luajit"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"static"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"buildvm"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
</code></pre>
</div>

<p>通过使用<a href="https://xmake.io/#/zh-cn/manual/project_target?id=targetset_plat">set_plat</a>和<a href="https://xmake.io/#/zh-cn/manual/project_target?id=targetset_arch">set_arch</a>接口，直接设置特定target到主机平台，就可以内部自动选择host工具链了。</p>

<p>关于这块的完整配置例子，可以参考：https://github.com/xmake-io/xmake-repo/blob/master/packages/l/luajit/port/xmake.lua</p>

<h2 id="远程包下载优化">远程包下载优化</h2>

<p>如果由于网络不稳定，导致下载包速度很慢或者下载失败，我们可以通过的下面的一些方式来解决。</p>

<h3 id="手动下载">手动下载</h3>

<p>默认xmake会调用curl, wget等工具来下载，用户也可以手动用自己的下载器下载（也可以使用代理），把下载后的包放到自己的目录下，比如: <code class="highlighter-rouge">/download/packages/zlib-v1.0.tar.gz</code></p>

<p>然后使用下面的命令，设置包下载的搜索目录：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> g --pkg_searchdirs="/download/packages"
</span></code></pre>
</div>

<p>然后重新执行xmake编译时候，xmake会优先从<code class="highlighter-rouge">/download/packages</code>找寻源码包，然后直接使用，不再自己下载了。</p>

<p>至于找寻的包名是怎样的呢，可以通过下面的命令查看：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> require --info zlib
</span>-&gt; searchdirs: /download/packages
-&gt; searchnames: zlib-1.2.11.tar.gz
</code></pre>
</div>

<p>我们可以看到对应的搜索目录以及搜索的包名。</p>

<h3 id="设置代理">设置代理</h3>

<p>如果觉得手动下载还是麻烦，我们也可以让xmake直接走代理。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> g --proxy="socks5://127.0.0.1:1086"
</span><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> g --help
</span>    -x PROXY, --proxy=PROXY  Use proxy on given port. [PROTOCOL://]HOST[:PORT]
                                 e.g.
                                 - xmake g --proxy='http://host:port'
                                 - xmake g --proxy='https://host:port'
                                 - xmake g --proxy='socks5://host:port'
</code></pre>
</div>

<p><code class="highlighter-rouge">--proxy</code>参数指定代理协议和地址，具体语法可以参考curl的，通常可以支持http, https, socks5等协议，但实际支持力度依赖curl, wget和git，比如wget就不支持socks5协议。</p>

<p>我们可以通过下面的参数指定哪些host走代理，如果没设置，默认全局走代理。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>--proxy_hosts=PROXY_HOSTS    Only enable proxy for the given hosts list, it will enable all if be unset,
                             and we can pass match pattern to list:
                                 e.g.
                                 - xmake g --proxy_hosts='github.com,gitlab.*,*.xmake.io'
</code></pre>
</div>

<p>如果设置了hosts列表，那么之后这个列表里面匹配的host才走代理。。</p>

<p><code class="highlighter-rouge">--proxy_host</code>支持多个hosts设置，逗号分隔，并且支持基础的模式匹配 *.github.com， 以及其他lua模式匹配规则也支持</p>

<p>如果觉得上面的hosts模式配置还不够灵活，我们也可以走pac的自动代理配置规则：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>--proxy_pac=PROXY_PAC    Set the auto proxy configuration file. (default: pac.lua)
                                     e.g.
                                     - xmake g --proxy_pac=pac.lua (in /Users/ruki/.xmake or absolute path)
                                     - function main(url, host)
                                           if host == 'github.com' then
                                                return true
                                           end
                                       end
</code></pre>
</div>

<p>!&gt; 如果有proxy_hosts优先走hosts配置，没有的话才走pac配置。</p>

<p>pac的默认路径：~/.xmake/pac.lua，如果–proxy被设置，并且这个文件存在，就会自动走pac，如果不存在，也没hosts，那就全局生效代理。</p>

<p>也可以手动指定pac全路径</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> g --proxy_pac=/xxxx/xxxxx_pac.lua
</span></code></pre>
</div>

<p>配置规则描述：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="k">function</span> <span class="nf">main</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">host</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">host</span><span class="p">:</span><span class="n">find</span><span class="p">(</span><span class="s2">"bintray.com"</span><span class="p">)</span> <span class="k">then</span>
        <span class="k">return</span> <span class="kc">true</span>
    <span class="k">end</span>
<span class="k">end</span>
</code></pre>
</div>

<p>如果返回true，那么这个url和host就是走的代理，不返回或者返回false，就是不走代理。</p>

<p>这块的具体详情见：<a href="https://github.com/xmake-io/xmake/issues/854">https://github.com/xmake-io/xmake/issues/854</a></p>

<p>!&gt; 另外，除了依赖包下载，其他涉及网络下载的命令也都支持代理，比如：<code class="highlighter-rouge">xmake update</code></p>

<h2 id="其他的小改动">其他的小改动</h2>

<h3 id="rc文件头文件依赖编译支持">rc文件头文件依赖编译支持</h3>

<p>虽然msvc里面的rc编译器原生并不支持导出.rc文件里面<code class="highlighter-rouge">#include &lt;xxx.h&gt;</code>头文件列表，不过xmake还是通过直接解析提取.rc源文件的方式，变相的把里面的头文件列表也提取了出来，实现头文件依赖编译支持。</p>

<p>虽然也许不够精准（还不能对宏进行处理），但也基本可用。</p>

<h3 id="改进modeminsizerel编译模式">改进mode.minsizerel编译模式</h3>

<p>新版本对msvc下的最小编译，默认开启了<code class="highlighter-rouge">/GL</code>编译选项，进一步的优化目标文件的大小，优化效果还是比较明显的。</p>

<p>关于这块详情，可以参考下：<a href="https://github.com/xmake-io/xmake/issues/835">https://github.com/xmake-io/xmake/issues/835</a></p>

<h3 id="改进protobuf规则支持">改进protobuf规则支持</h3>

<p>xmake内置的<code class="highlighter-rouge">protobuf.cpp</code>编译规则针对<code class="highlighter-rouge">*.proto</code>里面import多级子目录的情况，也进行了支持，之前只能使用同级下的proto文件。</p>

<p>也就是对<code class="highlighter-rouge">import common-files/b.proto</code>的这种情况：</p>

<div class="highlighter-rouge"><pre class="highlight"><code>proto-files
    a.proto
    common-files
        b.proto
</code></pre>
</div>

<p>对应的xmake.lua配置如下：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"protobuf-cpp"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">set_languages</span><span class="p">(</span><span class="s2">"c++11"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"protobuf-cpp"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"*.cpp"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"proto/**.proto"</span><span class="p">,</span> <span class="p">{</span><span class="n">rules</span> <span class="o">=</span> <span class="s2">"protobuf.cpp"</span><span class="p">,</span> <span class="n">proto_rootdir</span> <span class="o">=</span> <span class="s2">"proto"</span><span class="p">})</span>
</code></pre>
</div>

<p>相比之前，需要额外传递一个<code class="highlighter-rouge"><span class="p">{</span><span class="err">proto_rootdir</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="nt">""</span><span class="err">}</span></code>配置，来指定相对于import的所有proto的根目录才行。</p>

<p>关于这块的详情，见：<a href="https://github.com/xmake-io/xmake/issues/828">https://github.com/xmake-io/xmake/issues/828</a></p>

<h2 id="更新内容">更新内容</h2>

<h3 id="新特性">新特性</h3>

<ul>
  <li>添加<code class="highlighter-rouge">xmake show -l envs</code>去显示xmake内置的环境变量列表</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/861">#861</a>: 支持从指定目录搜索本地包去直接安装远程依赖包</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/854">#854</a>: 针对wget, curl和git支持全局代理设置</li>
</ul>

<h3 id="改进">改进</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/828">#828</a>: 针对protobuf规则增加导入子目录proto文件支持</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/835">#835</a>: 改进mode.minsizerel模式，针对msvc增加/GL支持，进一步优化目标程序大小</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/828">#828</a>: protobuf规则支持import多级子目录</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/838#issuecomment-643570920">#838</a>: 支持完全重写内置的构建规则，<code class="highlighter-rouge">add_files("src/*.c", {rules = {"xx", override = true}})</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/847">#847</a>: 支持rc文件的头文件依赖解析</li>
  <li>改进msvc工具链，去除全局环境变量的依赖</li>
  <li><a href="https://github.com/xmake-io/xmake/pull/857">#857</a>: 改进<code class="highlighter-rouge">set_toolchains()</code>支持交叉编译的时候，特定target可以切换到host工具链同时编译</li>
</ul>

<h3 id="bugs修复">Bugs修复</h3>

<ul>
  <li>修复进度字符显示</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/829">#829</a>: 修复由于macOS大小写不敏感系统导致的sysroot无效路径问题</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/832">#832</a>: 修复find_packages在debug模式下找不到的问题</li>
</ul>


        </article>
        <hr>

        <!-- baidu ads -->
        

        <!-- reward -->
        <div style="text-align: center;">
            <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
              <span>赏</span>
            </button>
            <div id="QR" style="display: none;">
                <div id="wechat" style="display: inline-block">
                  <img id="wechat_qr" src="/static/img/weixin.png" alt="WeChat Pay"/>
                  <p>微信打赏</p>
                </div>
                <div id="alipay" style="display: inline-block">
                  <img id="alipay_qr" src="/static/img/alipay.png" alt="Alipay"/>
                  <p>支付宝打赏</p>
                </div>
            </div>
        </div>

        
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
                    
                    <h2 id="english">English</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/2020/06/28/xmake-update-v2.3.5/">xmake v2.3.5 released, Multi-toolchain flexible switching support
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
        
            </ul>
        

        
        
            
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">相关文章</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/17/xmake-update-v2.6.2/">xmake v2.6.2 发布，新增 Linux 内核驱动模块构建支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 发布，使用 Lua5.4 运行时，Rust 和 C++ 混合编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 发布，改进 C++20 模块，并支持 Nim, Keil MDK 和 Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 发布，包依赖锁定和 Vala/Metal 语言编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>上一篇</strong> <a href="/cn/2020/06/05/xmake-update-v2.3.4/">xmake v2.3.4 发布, 更加完善的工具链支持</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>下一篇</strong> <a href="/cn/2020/07/04/byopen/">一个绕过移动端系统限制的dlopen库: byOpen</a></p>
        
    </div>
</div>


        <h2 id="comments">评论</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,       
  language: 'zh-CN',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    内容
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#english">English</a></li>
                    <li><a href="#similar_posts">相关文章</a></li>
                    <li><a href="#comments">评论</a></li>
                </ul>
            </div>


            <!-- baidu ads -->
            
            
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    链接
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- xmake courses -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    xmake 入门课程
                </div>
                <a href="https://xmake.io/#/zh-cn/about/course" target="_blank">
                <img src="/static/img/xmake-course.png" alt="course" width="256" height="193">
                </a>
            </div>

            <!-- qqgroup -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    技术交流群（QQ）
                </div>
                <img src="/static/img/qqgroup.png" alt="qqgroup" width="256" height="284">
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
